
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link rel=stylesheet href='include/hoj.css' type='text/css'>
</head>
<body>
<center>
<div style="width:90%; text-align:left">
<img src="image/logo.png"/>
</div>
<table width=96%> 
	<tr align="center" class='hd' valign="top">
				<th><a href="faqs.php">F.A.Qs</a></th>
		<th><a href="./bbs.php">Web Board</a></th>
		<th><a href="./">Home</a></th>
		<th><a href="./problemset.html">ProblemSet</a></th>
		<th><a href="./status.php">Status</a></th>
		<th><a href="./ranklist.php">Ranklist</a></th>
		<th><a href="./contest.php">Contest</a></th>
		<th><a href=loginpage.php>Login</a></th><th><a href=registerpage.php>Register</a></th>	</tr>
</table>
</center>
<center>
<div class="notice">
	<div>
		<B>Notice:</B>鉴于种种原因，本OJ自下周星期一（3月5号）开始不再全面开放，请各位做好善后事宜，谢谢合作。	</div>
</div>
</center>
</div>
<title>Problem 2395. -- [Balkan 2011]Timeismoney -- 衡阳八中OJ离线版-2012-02-29</title><center><h2>2395: [Balkan 2011]Timeismoney</h2><span class=green>Time Limit: </span>10 Sec&nbsp;&nbsp;<span class=green>Memory Limit: </span>128 MB<br><span class=green>Submit: </span>99&nbsp;&nbsp;<span class=green>Solved: </span>56<br>[<a href='submitpage.php?id=2395'>Submit</a>][<a href='problemstatus.php?id=2395'>Status</a>][<a href='bbs.php?id=2395'>Discuss</a>]</center><h2>Description</h2><div class=content><div><span>&nbsp;&nbsp;&nbsp;&nbsp; </span>有n个城市(编号从0..n-1)，m条公路(双向的)，从中选择n-1条边，使得任意的两个城市能够连通，一条边需要的c的费用和t的时间，定义一个方案的权值v=n-1条边的费用和*n-1条边的时间和，你的任务是求一个方案使得v最小</div></div><h2>Input</h2><div class=content><div style="text-indent: 20.25pt">第一行两个整数n,m,接下来每行四个整数a,b,c,t,表示有一条公路从城市a到城市b需要t时间和费用c</div></div><h2>Output</h2><div class=content><div>【output】timeismoney.out</div>
<div style="text-indent: 21pt">仅一行两个整数sumc，sumt,（sumc表示使得v最小时的费用和，sumc表示最小的时间和） 如果存在多个解使得sumc*sumt相等，输出sumc最小的</div></div><h2>Sample Input</h2>
			<div class=content><span class=sampledata>5 7<br />
0 1 161 79<br />
0 2 161 15<br />
0 3 13 153<br />
1 4 142 183<br />
2 4 236 80<br />
3 4 40 241<br />
2 1 65 92<br />
 <br />
</span></div><h2>Sample Output</h2>
			<div class=content><span class=sampledata>279 501<br />
 <br />
</span></div><h2>HINT</h2>
			<div class=content><p><p>【数据规模】<br /><br />
1&lt;=N&lt;=200<br /><br />
1&lt;=m&lt;=10000<br /><br />
0&lt;=a,b&lt;=n-1<br /><br />
0&lt;=t,c&lt;=255<br /><br />
有5%的数据m=n-1<br /><br />
有40%的数据有t=c<br /><br />
对于100%的数据如上所述</p></p></div><h2>Source</h2>
			<div class=content><p><a href='problemset.html?search=By 黄云南'>By 黄云南</a></p></div><center>[<a href='submitpage.php?id=2395'>Submit</a>][<a href='problemstatus.php?id=2395'>Status</a>][<a href='bbs.php?id=2395'>Discuss</a>]</center>﻿<br>

<a href="./"><span class=red>HOME</span></a>
<a href="javascript:history.go(-1)"><span class=red>Back</span></a>

<hr>
<center>
	<div class="footer">
			<a href=setlang.php?lang=ko>한국어</a>&nbsp;
		<a href=setlang.php?lang=cn>中文</a>&nbsp;
		<a href=setlang.php?lang=fa>فارسی</a>&nbsp;
		<a href=setlang.php?lang=en>English</a>&nbsp;
		<a href=setlang.php?lang=th>ไทย</a>
	<br>		<div>版权所有 &copy;2008-2012 WaterPark Organization. | <script src="http://s21.cnzz.com/stat.php?id=2982771&web_id=2982771" language="JavaScript"></script>
</div>
		<div>Based on opensource project <a href="http://hustoj.googlecode.com">hustoj</a>.</div>
	</div>
</center>
</body>
</html>
